feat(runner): write a screenshot to stdout with --out - - #1578
Draft
Goran Gajic (gorangajic) wants to merge 5 commits into
Draft
feat(runner): write a screenshot to stdout with --out -#1578Goran Gajic (gorangajic) wants to merge 5 commits into
Goran Gajic (gorangajic) wants to merge 5 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
`qawolf runner screenshot` only wrote a file, so a caller that wants the bytes in a process reserved a path, ran the command, read the file back and deleted it on every computer-use step. `--out -` writes the decoded JPEG to stdout instead, the same `-` that reads stdin for act and exec. Stdout then carries the image alone: the confirmation, and the JSON line under --json, moves to stderr so nothing follows the bytes into a reader that takes stdout as the file.
Goran Gajic (gorangajic)
force-pushed
the
goran/wiz-11974-qawolf-runner-screenshot-can-write-to-stdout
branch
from
September 7, 2026 13:03
f849ed3 to
329f313
Compare
4 tasks
Under Node a write to a closed pipe reports EPIPE twice: to the write callback, and as an error event a tick later. With no listener the event is an uncaught exception, so the unwritable answer the writer had just produced was followed by a crash and exit 1. The listener now goes on before the write and comes off only after a success. The test doubles are real Writable streams, since an object with only a write method never emits the event and hid the crash.
Only a terminal on stdout selects human mode, and a terminal cannot read JPEG bytes; the confirmation would also land among them, since clack prints to stdout, rather than on stderr as the message promises.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to WIZ-11974
Overview of Changes
qawolf runner screenshotonly wrote a file. The Tester session, which wants the bytes in a process, had to reserve a temp path, hand it to the sandboxed user, run the command, read the file back and delete it on every computer-use step.--out -now writes the decoded JPEG to stdout, the same-that already means stdin foractandexec. Stdout carries the image alone: the confirmation, and the JSON line under--json, goes to stderr so nothing follows the bytes into a reader that treats stdout as the file. A terminal on stdout is refused, since nothing there can read the bytes. The help text, the runner guide and the skill say so.Raw bytes rather than a base64 field in the JSON answer, because the repo's rule is to decode next to the write so nobody files base64 text as a JPEG, and because a byte stream is what a reader that pipes the command into a file or a viewer expects.
Testing
bun run typecheck bun run lint bun run format:check bun run knip bun run test bun run buildAdded tests: the writer sends decoded bytes to stdout and nothing to disk, refuses a non-JPEG answer for stdout too, and reports a closed pipe without letting the stream's error event crash the process (the doubles are real Writable streams for that reason); the handler keeps every confirmation off stdout in json and agent mode, refuses a terminal on stdout, and names stdout rather than a file when the pipe fails.
Checklist
🤖 Generated with Claude Code